package com.sky.mapper;
import com.sky.entity.User;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author 符健清
 * @version 1.0
 */
@SuppressWarnings({"all"})
@Mapper
public interface UserLoginServiceMapper {
    /**
     * 根据 openid 查询 表格数据
     * @param openid
     * @return
     */
    @Select("select * from user where  openid =#{openid}")
    User  login(String openid);

    /**
     * 创建新用户
     * @param user
     */
    @Insert(" insert into  user  ( openid, name, phone, sex, id_number, avatar, create_time)" +
            "value  (#{openid},#{name},#{phone},#{sex},#{idNumber},#{avatar},#{createTime})")
   void   insertUser(User user);
}
